Skip to content

fix(regex-tester): handle unmatched optional groups and mutually exclusive u/v flags - #2

Merged
SH20RAJ merged 1 commit into
SopKit:mainfrom
playlikeboy:fix/regex-tester-optional-groups-and-flags
Nov 27, 2026
Merged

SH20RAJ merged 1 commit into
SopKit:mainfrom
playlikeboy:fix/regex-tester-optional-groups-and-flags

Conversation

@playlikeboy

Copy link
Copy Markdown

Summary

  • Guard matchRegex in src/tools/regex-tester/regex-tester.service.ts when optional or alternation capture/named groups are undefined (preventing TypeError when indexing match.indices, which previously caused regex-tester.vue to swallow the error and falsely display "No match").
  • Make unicode (u) and unicodeSets (v) checkboxes mutually exclusive in regex-tester.vue and pass active regexFlags to useValidation.
  • Add unit tests in src/tools/regex-tester/regex-tester.service.test.ts for (a)|(b), (a)?b, and (?<a>foo)|(?<b>bar).

Verification

  • pnpm eslint on modified files (0 errors, 0 warnings)
  • pnpm vitest run --environment jsdom src/tools/regex-tester/regex-tester.service.test.ts (8 passed)
  • pnpm typecheck (exit code 0)

SH20RAJ commented Nov 27, 2026

Copy link
Copy Markdown

Thanks for the contribution. The patch addresses undefined optional/named capture groups and keeps the u/v flags mutually exclusive; the regression cases for alternation and optional groups are a good fit. The PR description records the focused Vitest, lint, and typecheck runs. GitHub currently shows no CI check runs on this head.

@SH20RAJ
SH20RAJ merged commit 1332f37 into SopKit:main Nov 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants